<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link href="css/mui.min.css" rel="stylesheet" />

		<style>
			ul {
				font-size: 14px;
				color: #8f8f94;
			}

			.mui-btn {
				padding: 10px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav" style="padding-right: 15px;">
			<h1 class="mui-title">登录模板</h1>
			<button id='setting' class=" mui-pull-right mui-btn-link">设置</button>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded">
				<p>
					您好 <span id='account'></span>，您已成功登录。
				</p>
			</div>
			<ul class="mui-table-view mui-grid-view mui-grid-9">
				<li id="edit" class="mui-table-view-cell mui-media mui-col-xs-6 mui-col-sm-6"><a href="#">
						<span class="mui-icon mui-icon-compose"></span>
						<div class="mui-media-body">录入数据</div>
					</a></li>
				<li id="search" class="mui-table-view-cell mui-media mui-col-xs-6 mui-col-sm-6"><a href="#">
						<span class="mui-icon mui-icon-bars"></span>
						<div class="mui-media-body">查询数据</div>
					</a></li>
			</ul>
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/app.js"></script>
		<script src="js/mui.meeting.js"></script>
		<script>
			(function($, doc) {
				$.init();
				var settings = app.getSettings();
				var account = doc.getElementById('account');
				//
				window.addEventListener('show', function() {
					var state = app.getState();
					account.innerText = state.account;
				}, false);
				$.plusReady(function() {
					/*====================菜单========================*/
					document.getElementById("edit").addEventListener("tap", function() {
						meeting.Form.openWindow("edit", "录入数据")
					})
					document.getElementById("search").addEventListener("tap", function() {
						meeting.Form.openWindow("search", "查看数据")
					})
					/*====================设置========================*/
					var settingPage = $.preload({
						"id": 'setting',
						"url": 'setting.html'
					});
					//设置
					var settingButton = doc.getElementById('setting');
					//settingButton.style.display = settings.autoLogin ? 'block' : 'none';
					settingButton.addEventListener('tap', function(event) {
						$.openWindow({
							id: 'setting',
							show: {
								aniShow: 'pop-in'
							},
							styles: {
								popGesture: 'hide'
							},
							waiting: {
								autoShow: false
							}
						});
					});
					//--
					/* 					$.oldBack = mui.back;
										var backButtonPress = 0;
										$.back = function(event) {
											backButtonPress++;
											if (backButtonPress > 1) {
												plus.runtime.quit();
											} else {
												plus.nativeUI.toast('再按一次退出应用');
											}
											setTimeout(function() {
												backButtonPress = 0;
											}, 1000);
											return false;
										}; */
				});
			}(mui, document));
		</script>
	</body>

</html>
